package com.atos.optical.model.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author wanghra
 * @version 1.0
 * @description 产品信息表
 * @date 2025/8/15
 */
@Data
@Entity
@Table
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class SysProductInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @Column(name = "PRODUCT_ID", length = 50, nullable = false)
    @TableId(value = "PRODUCT_ID", type = IdType.ASSIGN_UUID)
    private String productId;
    /**
     * 产品类型ID
     */
    @Column(name = "TYPE_ID", length = 50, nullable = false)
    @TableField(value = "TYPE_ID")
    private String typeId;
    /**
     * 产品价格
     */
    @Column(name = "PRODUCT_PRICE", nullable = false)
    @TableField(value = "PRODUCT_PRICE")
    private Double productPrice;
    /**
     * 产品数量
     */
    @Column(name = "PRODUCT_NUM", nullable = false)
    @TableField(value = "PRODUCT_NUM")
    private Integer productNum;
    /**
     * 修订版本
     */
    @Column(name = "VERSION", length = 10, nullable = false)
    @TableField(value = "VERSION")
    private String version;
    /**
     * 创建日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "CREATE_TIME")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT, insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime createTime;
    /**
     * 修改日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "MODIFY_TIME")
    @TableField(value = "MODIFY_TIME", fill = FieldFill.UPDATE)
    private LocalDateTime modifyTime;
}
